# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kgpg
pkgver=20.04.3
pkgrel=0
arch="all !armhf"
url="https://kde.org/applications/utilities/org.kde.kgpg"
pkgdesc="A simple interface for GnuPG, a powerful encryption utility"
license="GPL-2.0-or-later"
makedepends="extra-cmake-modules qt5-qtbase-dev karchive-dev kdoctools-dev kcodecs-dev kcoreaddons-dev kcrash-dev kdbusaddons-dev ki18n-dev kiconthemes-dev kjobwidgets-dev kio-dev knotifications-dev kservice-dev ktextwidgets-dev kxmlgui-dev kwidgetsaddons-dev kwindowsystem-dev akonadi-contacts-dev kcontacts-dev gpgme-dev"
source="https://download.kde.org/stable/release-service/$pkgver/src/kgpg-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	# kgpg-import fails too often
	# kgpg-encrypt and kgpg-export are broken
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "kgpg-(import|encrypt|export)"
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="b36ff19ee02a8bbaa64cfece378178fd4d10700a0f62a44e3d911cebeb147564c577336681937e3be795924ab1da522a38b07a32335c95c3c7f711361f0a8a9c  kgpg-20.04.3.tar.xz"
